package com.iplant.ams.service.basicenum.dms.scada;


import com.iplant.base.po.enums.BaseEnum;

/**
 * 采集模式
 */
public enum DMSDeviceStatusEnum implements BaseEnum {

    /**
     * 开机
     */
    TurnOff(0b0000000000000000, "关机"),
    /**
     * 开机
     */
    TurnOn(0b0000000000000001, "开机"),
    /**
     * 运行
     */
    Run(0b0000000000000010, "运行"),
    /**
     * 停止
     */
    Stop(0b0000000000000100, "停止"),
    /**
     * 急停
     */
    EmergencyStop(0b0000000000001000, "急停"),
    /**
     * 报警
     */
    Alarm(0b0000000000010000, "报警"),

    /**
     * 手动
     */
    Manual(0b0000000000100000, "手动"),

    /**
     * 自动
     */
    Auto(0b0000000000100000, "自动"),

    /**
     * 等待
     */
    Wait(0b0000000000100000, "等待"),

    Undefine1(0b0000000000100000, "未定义1"),

    Undefine2(0b0000000000100000, "未定义2"),

    Undefine3(0b0000000000100000, "未定义3"),

    Undefine4(0b0000000000100000, "未定义4"),

    Undefine5(0b0000000000100000, "未定义5"),

    Undefine6(0b0000000000100000, "未定义6"),

    Undefine7(0b0000000000100000, "未定义7"),

    Undefine8(0b0000000000100000, "未定义8") ;

    private int value;
    private String label;
    private String remark = "";

    DMSDeviceStatusEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    public static DMSDeviceStatusEnum getEnumType(int val) {
        for (DMSDeviceStatusEnum type : DMSDeviceStatusEnum.values()) {
            if (type.getValue() == val) {
                return type;
            }
        }
        return TurnOff;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public void setValue(int value) {
        this.value = value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
